package com.fingard.dsp.core.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 *
 * @author Fantx
 * @version 1.0
 * @date 2020-08-11 19:51
 */
@MapperScan("com.fingard.dsp.core.dao")
@EnableTransactionManagement
@Configuration
public class MybatisPlusConfig {

    /**
     * Mybatis-plus乐观锁配置
     *
     * @return
     */
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor() {
        return new OptimisticLockerInterceptor();
    }
}
